package net.sf.midollo.net.io;

import java.io.IOException;
import java.net.URL;
import java.net.URLConnection;

import net.sf.midollo.io.IOStream;
import net.sf.midollo.io.IOStreamFactory;

public class URLIOStreamFactory implements IOStreamFactory {

  protected final URL url;

  public URLIOStreamFactory(URL url) {
    this.url = url;
  }

  public IOStream open() throws IOException {
    URLConnection urlConnection = this.url.openConnection();
    return new URLIOStream(urlConnection);
  }
}
